package com.gouaixin.bee.beeframework2.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.gouaixin.bee.beeframework2.R;

import org.json.JSONArray;

import java.util.ArrayList;
import java.util.HashMap;

public class ZuixinAdapter extends BaseAdapter {



	Context context;
//	ArrayList<HashMap<String, Object>> al;
	LayoutInflater mInflater;
    JSONArray jsonArray;

    public ZuixinAdapter(Context context) {
        this.context = context;
//		this.al = al;
        mInflater = LayoutInflater.from(context);

    }


	public ZuixinAdapter(Context context, ArrayList<HashMap<String, Object>> al) {
		this.context = context;
//		this.al = al;
		mInflater = LayoutInflater.from(context);
		
	}

    public ZuixinAdapter(Context context, JSONArray jsonArray) {
        this.context = context;
//		this.al = al;
        mInflater = LayoutInflater.from(context);
        this.jsonArray=jsonArray;

    }

	public int getCount() {
		return 10;
	}

	public Object getItem(int position) {
		return null;
	}

	public long getItemId(int position) {
		return position;
	}


	
	
	public View getView(int position, View convertView, ViewGroup parent) {

		ViewHolder viewHolder;
		
		if(convertView == null){
			
			convertView = mInflater.inflate(R.layout.tuijian_item, null);
			viewHolder = new ViewHolder();

			viewHolder.icon = (ImageView) convertView.findViewById(R.id.icon);
			viewHolder.qianming = (TextView) convertView.findViewById(R.id.qianming);
			viewHolder.name = (TextView) convertView.findViewById(R.id.name);
			viewHolder.dianzanNum = (TextView) convertView.findViewById(R.id.dianzanNum);
			viewHolder.age = (TextView) convertView.findViewById(R.id.age);
			viewHolder.height = (TextView) convertView.findViewById(R.id.height);
			viewHolder.address = (TextView) convertView.findViewById(R.id.address);
            viewHolder.zhaohu = (ImageView) convertView.findViewById(R.id.zhaohu);
            viewHolder.guanzhu = (ImageView) convertView.findViewById(R.id.guanzhu);

			convertView.setTag(viewHolder);

		}else {

			viewHolder = (ViewHolder) convertView.getTag();
		}

//		HashMap<String, Object> map = al.get(position);
		viewHolder.name.setText("最新对象"+position);


		return convertView;
	}
	/**
	 * �ڲ���
	 */
	class ViewHolder {
        ImageView icon;
		TextView qianming;
		TextView name;
		TextView dianzanNum;
		TextView age;
		TextView height;
		TextView address;
        ImageView zhaohu;
        ImageView guanzhu;
	}
	
	
	
	
	
}
